package springcloud_nacos_config.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RefreshScope	//实时刷新配置信息
public class NacosConfig {
	//	读取key为nacos.config的配置的值，并通过/get接口返回
	@Value("${nacos.config}") 
    private String config;

    @RequestMapping("/get")
    public String getValue() {
        return config;
    }
}
